﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:system="clr-namespace:System;assembly=mscorlib"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                   >
    
    
    <SolidColorBrush x:Key="MenuColor" Color="#FF0072C6" />
    <SolidColorBrush x:Key="DarkBorderBrush" Color="#9D000000" />
    <SolidColorBrush x:Key="ContextMenuBackground" Color="#FF2A3345" />
    <system:Double x:Key="SizePressed">0.90</system:Double>
    <Duration x:Key="PressedTime">0:0:0.1</Duration>
    <FontFamily x:Key="FontFamily">Segoe UI</FontFamily>
    <system:Double x:Key="FontSize">13</system:Double>
    <SolidColorBrush x:Key="MouseOverLayer" Color="#1BFFFFFF" />
    <SolidColorBrush x:Key="MousePressedLayer" Color="#1B000000" />
    <SolidColorBrush x:Key="BackgroundColor" Color="#FFFFE979" />
    <SolidColorBrush x:Key="StandardColor" Color="Gray" />
    <SolidColorBrush x:Key="PressBackgroundColor" Color="#FFEEA844" />

    <Style x:Key="BorderlessTextBox" TargetType="TextBox">
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="CaretBrush" Value="Transparent" />
        <Setter Property="FontFamily" Value="{StaticResource FontFamily}"/>
        <Setter Property="FontSize" Value="{StaticResource FontSize}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TextBox">
                    <Border BorderThickness="1" Background="#01111111" Name="border">
                        <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="border" Property="BorderBrush" Value="#55000000" />
                            <Setter Property="CaretBrush" Value="#55000000" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type Button}" >
        <Setter Property="FontFamily" Value="{StaticResource FontFamily}"/>
        <Setter Property="FontSize" Value="{StaticResource FontSize}" />
        <Setter Property="Foreground" Value="Black"></Setter>
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        <Grid.RenderTransformOrigin>
                            <Point X="0.5" Y="0.5"/>
                        </Grid.RenderTransformOrigin>
                        <Grid.RenderTransform >
                            <ScaleTransform x:Name="ScaleTransform" ScaleX="1.0" ScaleY="1.0"></ScaleTransform>
                        </Grid.RenderTransform>
                        <Border 
                            x:Name="Border"  
                            BorderThickness="1"
                            Background="{TemplateBinding Background}"
                            BorderBrush="Gray">
                            <ContentPresenter 
                                Margin="2"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                RecognizesAccessKey="True"/>
                        </Border>
                        <Border x:Name="action" Background="Transparent" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="action" Property="Background" Value="{StaticResource MouseOverLayer}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="action" Property="Background" Value="{StaticResource MousePressedLayer}" />
                            <!--<Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard TargetName="ScaleTransform" TargetProperty="ScaleX">
                                        <DoubleAnimation To="{StaticResource SizePressed}" Duration="0:0:0.2"/>
                                    </Storyboard>
                                </BeginStoryboard>
                                <BeginStoryboard>
                                    <Storyboard TargetName="ScaleTransform" TargetProperty="ScaleY">
                                        <DoubleAnimation To="{StaticResource SizePressed}" Duration="0:0:0.2" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard TargetName="ScaleTransform" TargetProperty="ScaleX">
                                        <DoubleAnimation To="1" Duration="0:0:0.2"/>
                                    </Storyboard>
                                </BeginStoryboard>
                                <BeginStoryboard>
                                    <Storyboard TargetName="ScaleTransform" TargetProperty="ScaleY">
                                        <DoubleAnimation To="1" Duration="0:0:0.2" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>-->
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <!--  Scrollbar Buttons  -->
    <Style x:Key="ScrollButtons" TargetType="{x:Type RepeatButton}">
        <Setter Property="Focusable" Value="false" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Foreground" Value="{StaticResource StandardColor}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Border Name="Border" Background="Transparent">
                        <ContentPresenter Name="ContentPresenter"
						                  HorizontalAlignment="Center"
						                  VerticalAlignment="Center"
						                  Content="{TemplateBinding Content}"
						                  ContentTemplate="{TemplateBinding ContentTemplate}"
						                  ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--Scrollbar Thumbs-->
    <Style x:Key="ScrollThumbs" TargetType="{x:Type Thumb}">
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Rectangle Name="ellipse" Fill="LightGray" />
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="ellipse" Property="Fill" Value="{StaticResource PressBackgroundColor}"></Setter>
                        </Trigger>
                        <Trigger Property="IsDragging" Value="True">
                            <Setter TargetName="ellipse" Property="Fill" Value="{StaticResource PressBackgroundColor}"></Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  Scrollbar  -->
    <Style TargetType="{x:Type ScrollBar}">
        <Setter Property="Stylus.IsFlicksEnabled" Value="false" />
        <Setter Property="Foreground" Value="Transparent" />
        <Setter Property="Background" Value="WhiteSmoke" />
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="Width" Value="12" />
        <Setter Property="Margin" Value="2" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ScrollBar}">
                    <Grid x:Name="GridRoot"
					      Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidth}}"
					      Background="{TemplateBinding Background}">
                        <Grid.RowDefinitions>
                            <RowDefinition MaxHeight="18" />
                            <RowDefinition Height="0.00001*" />
                            <RowDefinition MaxHeight="18" />
                        </Grid.RowDefinitions>
                        <RepeatButton x:Name="DecreaseRepeat"
						              Command="ScrollBar.LineUpCommand"
						              Style="{StaticResource ScrollButtons}">
                            <Path x:Name="DecreaseArrow"
							      HorizontalAlignment="Center"
							      VerticalAlignment="Center"
							      Data="F1 M 3.5,0L 0,7L 7,7L 3.5,0 Z "
							      Fill="{StaticResource StandardColor}" />
                        </RepeatButton>
                        <Track x:Name="PART_Track"
						       Grid.Row="1"
						       Focusable="false"
						       IsDirectionReversed="true">
                            <Track.Thumb>
                                <Thumb x:Name="Thumb"
								       Background="{StaticResource BackgroundColor}"
								       Style="{StaticResource ScrollThumbs}" />
                            </Track.Thumb>
                            <Track.IncreaseRepeatButton>
                                <RepeatButton x:Name="PageUp"
								              Command="ScrollBar.PageDownCommand"
								              Focusable="false"
								              Opacity="0" />
                            </Track.IncreaseRepeatButton>
                            <Track.DecreaseRepeatButton>
                                <RepeatButton x:Name="PageDown"
								              Command="ScrollBar.PageUpCommand"
								              Focusable="false"
								              Opacity="0" />
                            </Track.DecreaseRepeatButton>
                        </Track>
                        <RepeatButton x:Name="IncreaseRepeat"
						              Grid.Row="2"
						              Command="ScrollBar.LineDownCommand"
						              Style="{StaticResource ScrollButtons}">
                            <Path x:Name="IncreaseArrow"
							      HorizontalAlignment="Center"
							      VerticalAlignment="Center"
							      Data="F1 M 3.5,7L 7,0L 0,0L 3.5,7 Z "
							      Fill="{StaticResource StandardColor}" />
                        </RepeatButton>
                    </Grid>

                    <ControlTemplate.Triggers>

                        <Trigger SourceName="IncreaseRepeat" Property="IsMouseOver" Value="true">
                            <Setter TargetName="IncreaseArrow" Property="Fill" Value="{StaticResource PressBackgroundColor}"></Setter>
                        </Trigger>
                        <Trigger SourceName="DecreaseRepeat" Property="IsMouseOver" Value="true">
                            <Setter TargetName="DecreaseArrow" Property="Fill" Value="{StaticResource PressBackgroundColor}"></Setter>
                        </Trigger>
                        <Trigger SourceName="Thumb" Property="IsMouseOver" Value="true">
                            <Setter TargetName="Thumb" Property="Background" Value="{StaticResource StandardColor}" />
                        </Trigger>
                        <Trigger SourceName="Thumb" Property="IsDragging" Value="true">
                            <Setter TargetName="Thumb" Property="Background" Value="{StaticResource StandardColor}" />
                        </Trigger>

                        <Trigger SourceName="IncreaseRepeat" Property="IsPressed" Value="true">
                            <Setter TargetName="IncreaseArrow" Property="Fill" Value="{StaticResource StandardColor}" />
                        </Trigger>
                        <Trigger SourceName="DecreaseRepeat" Property="IsPressed" Value="true">
                            <Setter TargetName="DecreaseArrow" Property="Fill" Value="{StaticResource StandardColor}" />
                        </Trigger>

                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="IncreaseArrow" Property="Fill" Value="{DynamicResource LayerChild1Brush}" />
                            <Setter TargetName="DecreaseArrow" Property="Fill" Value="{DynamicResource LayerChild1Brush}" />
                            <Setter TargetName="Thumb" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                        <Trigger Property="Orientation" Value="Horizontal">
                            <Setter TargetName="GridRoot" Property="LayoutTransform">
                                <Setter.Value>
                                    <RotateTransform Angle="-90" />
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="PART_Track" Property="LayoutTransform">
                                <Setter.Value>
                                    <RotateTransform Angle="-90" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Width" Value="Auto" />
                            <Setter Property="Height" Value="12" />
                            <Setter TargetName="Thumb" Property="Tag" Value="Horizontal" />
                            <Setter TargetName="DecreaseRepeat" Property="Command" Value="ScrollBar.LineLeftCommand" />
                            <Setter TargetName="IncreaseRepeat" Property="Command" Value="ScrollBar.LineRightCommand" />
                            <Setter TargetName="PageDown" Property="Command" Value="ScrollBar.PageLeftCommand" />
                            <Setter TargetName="PageUp" Property="Command" Value="ScrollBar.PageRightCommand" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


</ResourceDictionary>